home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / doc / plot07 < prev    next >
Text File  |  1997-07-08  |  1KB  |  34 lines

  1. ; This batch file creates a bar chart used as an example in
  2. ; Chapter 10, "Plotting", of _Using IDL_.
  3.  
  4. ; Compile the file plot05.pro, which contains two IDL procedures
  5. ; named "BOX" and "BARGRAPH". 
  6.  
  7. .r plot05.pro
  8.  
  9. ; Run a batch file to define the variables used in this plot.
  10.  
  11. @plot01
  12.  
  13. ; Define tick x values: 0.2, 0.4, 0.6, 0.8.
  14.  
  15. XVAL = FINDGEN(4)/5. + .2    
  16.  
  17. ; Make a vector of scores from first year, corresponding to the name 
  18. ; vector from above.
  19.  
  20. YVAL = [COHO(0), SOCKEYE(0), HUMPBACK(0), CHINOOK(0)]
  21.  
  22. ; Make the axes with no data. Force x range to [0, 1], centering xval, 
  23. ; which also contains the tick values. Force three tick intervals making 
  24. ; four tick marks. Specify the tick names from the names vector.
  25.  
  26. PLOT, XVAL, YVAL, /YNOZERO, XRANGE = [0,1], XTICKV = XVAL, $
  27.     XTICKS = 3, XTICKNAME = NAMES, /NODATA, TITLE = 'Salmon Populations, 1967'    
  28.  
  29. ; Draw the boxes, centered over the tick marks. !Y.CRANGE(0) is the 
  30. ; y value of the bottom x-axis.
  31.  
  32. FOR I = 0, 3 DO BOX, XVAL(I) - .08, !Y.CRANGE(0), $
  33.     XVAL(I) + 0.08, YVAL(I), 128    
  34.